import request from '@/utils/request'

// 查询列表
export function listDrawingDesign(query) {
  return request({
    url: '/design-info/list',
    method: 'post',
    data: query
  })
}

// 查询详细
export function getDrawingDesignDetail(id) {
  return request({
    url: '/design-info/getById/' + id,
    method: 'get'
  })
}

// 获取 片区
export function getDept() {
  return request({
    url: '/auth/dept/treeselect',
    method: 'get'
  })
}

// 新增
export function addDrawingDesignDetail(data) {
  return request({
    url: '/design-info/add',
    method: 'post',
    data: data
  })
}

// 修改
export function updateDrawingDesignDetail(data) {
  return request({
    url: '/design-info/update',
    method: 'post',
    data: data
  })
}

// 软删除
export function delDrawingDesign(roleId) {
  if (!(roleId instanceof Array)){
    roleId = [roleId]
  }
  return request({
    url: '/design-info/delete',
    method: 'post',
    data: roleId,
  })
}

// 片区 下拉选
export function zoneOption(){
  return request({
    url: '/design-info/option',
    method: 'get'
  })
}


/**
 *查询任务分配按钮权限
 * @param projectId
 */
export function getTaskDistributeBtnById(projectId) {
  return request({
    url: `/budget-info/complete/${projectId}`,
    method: 'get',
  })
}

/**
 *任务分配
 * @param projectId
 * @param dealOa
 * @param dealName
 */
export function setTaskDistributeApi(projectId,dealOa,dealName) {
  return request({
    url: `/design-info/setYuSuan`,
    method: 'post',
    data:{
      projectId,dealOa,dealName
    }
  })
}
